CREATE TABLE VPI.EXTRACT_PLUGIN
(
	PLUGIN_ID		VARCHAR2(32) 			NOT NULL,
	INTERFACE_ID	VARCHAR2(32) 			NOT NULL,
	PLUGIN_VIEW		VARCHAR2(61) 			NOT NULL,
	PLUGIN_ORDER	NUMBER(3) DEFAULT 999	NOT NULL,
	DESCRIPTION_	VARCHAR2(512),

	CONSTRAINT PK_EXTRACT_PLUGIN PRIMARY KEY (PLUGIN_ID),
	CONSTRAINT CK_EXTRACT_PLUGIN_ID CHECK (PLUGIN_ID = UPPER(PLUGIN_ID)),
	CONSTRAINT FK_EXTRACT_PLUGIN_INTF FOREIGN KEY (INTERFACE_ID) REFERENCES VPI.EXTRACT_INTERFACE (INTERFACE_ID),
	CONSTRAINT UK_EXTRACT_PLUGIN UNIQUE (PLUGIN_VIEW),
	CONSTRAINT CK_EXTRACT_PLUGIN_VIEW CHECK (PLUGIN_VIEW = UPPER(PLUGIN_VIEW))
)
STORAGE (INITIAL 64K NEXT 256K);

CREATE INDEX VPI.IX_EXTRACT_PLUGIN_I ON VPI.EXTRACT_PLUGIN (INTERFACE_ID, PLUGIN_ORDER);

COMMENT ON COLUMN VPI.EXTRACT_PLUGIN.PLUGIN_ID
	IS 'The unique identifier for the plug-in, consider a naming convention within the enterprise.';
COMMENT ON COLUMN VPI.EXTRACT_PLUGIN.INTERFACE_ID
	IS 'The interface of the plug-in belongs to.';
COMMENT ON COLUMN VPI.EXTRACT_PLUGIN.PLUGIN_VIEW
	IS 'The view which will implement the plug-in.';
COMMENT ON COLUMN VPI.EXTRACT_PLUGIN.PLUGIN_ORDER
	IS 'The order where the plug-in will be assembled in the interface union view.';
